package com.raising.modules.sys.entity;

import com.raising.framework.entity.BaseEntity;

/**
 * 组织机构表（单位）
 *
 * @author gaoy
 */
public class Organization extends BaseEntity<Organization> {
	private static final long serialVersionUID = 1L;
	/** 组织机构名称*/
	private String name;
	/**父编号*/
	private String parentId;
	/**上级机构*/
	private Organization organization;
	 /**父级的父级编号列表*/
	private String parentParentIds;
	private Boolean available = Boolean.TRUE;
	private User user;

	/** 简称 */
	private String shortName;
	/** 照片 */
	private String photo;
	/** 编号 */
	private String no;
	/** 级别 */
	private String level;

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public Organization() {
		super();
	}

	public Organization(String id) {
		super(id);
	}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

	public Organization getOrganization() {
		return organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}

	public Boolean getAvailable() {
		return available;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}

	public boolean isRootNode() {
		return "0".equals(parentId);
	}

	public String getParentParentIds() {
		return parentParentIds;
	}

	public void setParentParentIds(String parentParentIds) {
		this.parentParentIds = parentParentIds;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}


	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	@Override
	public String toString() {
		return "Organization{" +
				"name='" + name + '\'' +
				", parentId='" + parentId + '\'' +
				", organization=" + organization +
				", parentParentIds='" + parentParentIds + '\'' +
				", available=" + available +
				", user=" + user +
				", shortName='" + shortName + '\'' +
				", photo='" + photo + '\'' +
				", no='" + no + '\'' +
				'}';
	}
}
